<?php

// +----------------------------------------------------------------------
// | theme 自定义验证器
// +----------------------------------------------------------------------
// | @author fancsen
// +----------------------------------------------------------------------
namespace app\api\validate;

class IDCollection extends BaseValidate
{
    protected $rule = [
		'ids' => 'require|checkIds',
	];
    protected $message = [
        'ids' => 'ids规则不符'
    ];

    protected function checkIds($value)
    {
        $values = explode(',',$value);
        if(empty($values)){
            return false;
        }
        foreach ($values as $k => $v) {
            if(!$this->isPositiveInteger($v)){
                return false;
            }
        }
        return true;
    }


    
}